package pub.wii.cook.thrift.server;

import lombok.SneakyThrows;
import org.apache.thrift.server.TServer;
import org.apache.thrift.server.TSimpleServer;
import org.apache.thrift.transport.TServerSocket;
import org.apache.thrift.transport.TServerTransport;
import pub.wii.cook.thrift.TicketService;
import pub.wii.cook.thrift.service.TicketServiceImpl;

public class TicketServer {
    @SneakyThrows
    public static void main(String[] args) {
        TServerTransport serverTransport = new TServerSocket(9090);
        TicketService.Processor processor = new TicketService.Processor(new TicketServiceImpl());
        TServer.Args arg = new TServer.Args(serverTransport);
        arg.processor(processor);
        TServer server = new TSimpleServer(arg);
        server.serve();
    }
}
